import time
import datetime

#print time.mktime(time.strptime('2012-04-19 14:16:07', '%Y-%m-%d %H:%M:%S'))

print time.mktime(time.strptime('Fri Dec 10 08:55:50 +0800 2010', '%a %b %d %H:%M:%S +0800 %Y' ))

unixtime = time.time()
print unixtime


t = time.localtime(unixtime)
print t, type(t)
print t.tm_hour

print time.strftime('%Y-%m-%d %H:%M:%S', t)

t = datetime.date.today()
print 'date_today', t, type(t)
print 'date_fromtimestamp', datetime.date.fromtimestamp(unixtime),datetime.date.fromtimestamp(unixtime).strftime('%m-%d')

t2 = t.replace(day=13)

print t2-t, type(t2-t), t2 < t

print str(t2)
